package com.sdap2.vo;

import com.sdap2.entity.Greenhouse;
import lombok.Data;

import java.time.LocalDateTime;
import java.math.BigDecimal;

@Data
public class GreenhouseVO {
    private Long id;
    private String name;
    private String address;
    private BigDecimal area;
    private Integer status;
    private String boxNo;
    private String accessToken;
    private LocalDateTime createTime;
    private LocalDateTime updateTime;
    
    public static GreenhouseVO fromEntity(Greenhouse greenhouse) {
        if (greenhouse == null) {
            return null;
        }
        
        GreenhouseVO vo = new GreenhouseVO();
        vo.setId(greenhouse.getId());
        vo.setName(greenhouse.getName());
        vo.setAddress(greenhouse.getAddress());
        vo.setArea(greenhouse.getArea());
        vo.setStatus(greenhouse.getStatus());
        vo.setBoxNo(greenhouse.getBoxNo());
        vo.setAccessToken(greenhouse.getAccessToken());
        vo.setCreateTime(greenhouse.getCreateTime());
        vo.setUpdateTime(greenhouse.getUpdateTime());
        return vo;
    }
} 